package com.example.imchat;

import android.app.Application;
import android.content.Context;

import com.example.imchat.model.Model;
import com.hyphenate.chat.EMOptions;
import com.hyphenate.easeui.EaseUI;

/*
* 20 5/2    lee
* */
public class IMApplication extends Application {
    private static Context mContext;
    @Override
    public void onCreate() {
        super.onCreate();
        //初始化easeUI
        EMOptions options = new EMOptions();
        options.setAcceptInvitationAlways(false);  //设置需要同意才能接受邀请
        options.setAutoAcceptGroupInvitation(false);//设置需要同意才能接受群邀请
        EaseUI.getInstance().init(this,options);

        //初始化数据模型类
        Model.getInstance().init(this);

        //初始化全局上下文
        mContext = this;
    }
    public static Context getGlobalApplication(){
        return mContext;
    }
}
